<template>
  <view class="recordVideo">
    <image class="recordVideo-imgCover" :src="imgUrl"></image>
    <view class="recordVideo-imgCoverMask"></view>
    <image
      class="recordVideo-playBtn"
      src="@/pagesA/static/images/chat/video_play.png"
    ></image>
  </view>
</template>

<script setup lang="ts">
import { getFileUrl } from "@/utils/util";
import { computed } from "vue";

const props = defineProps({
  cover: {
    type: String,
    default: "",
  },
});

const imgUrl = computed(() => {
  return getFileUrl(props.cover) || "";
});
</script>

<style lang="scss" scoped>
.recordVideo {
  border-radius: 12rpx;
  width: calc(56vw - 36rpx);
  height: 225rpx;
  margin-bottom: 24rpx;
  position: relative;
  &-imgCover {
    width: 100%;
    height: 100%;
    border-radius: 8rpx;
  }
  &-imgCoverMask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8rpx;
  }
  &-playBtn {
    width: 48rpx;
    height: 48rpx;
    // background: #ffffff;
    border-radius: 25rpx;
    position: absolute;
    top: calc(50% - 24rpx);
    bottom: calc(50% - 24rpx);
    left: calc(50% - 24rpx);
    right: calc(50% - 24rpx);
  }
}
</style>
